<template>
  <div>
    <div class="cont">
      <!-- <h1>演示Vuex的使用</h1> -->
      <CompA />
      <CompB />
      <CompC />
    </div>
    <div v-for="item in categoryList" :key="item.objectId">
      {{ item.name }}
    </div>
  </div>
</template>

<script>
import CompA from "./comp-a.vue";
import CompB from "./comp-b.vue";
import CompC from "./comp-c.vue";
export default {
  components: {
    CompA,
    CompB,
    CompC,
  },
  computed: {
    categoryList() {
      return this.$store.state.category.categoryList;
    },
  },
  created() {
    // this.$store.dispatch("category/categoryAct"); //触发action的执行
  },
};
</script>

<style lang="scss" scoped>
.cont {
  display: flex;
}
</style>
